<?php
define('ROOT_PATH', realpath(dirname(__FILE__) . '/..'));

set_include_path(implode(PATH_SEPARATOR, array(
    realpath(ROOT_PATH . '/library'),
    realpath(ROOT_PATH. '/vendor'),
    get_include_path(),
)));

require_once 'Zend/Loader/Autoloader.php';
$autoloader = Zend_Loader_Autoloader::getInstance();
$autoloader->setFallbackAutoloader(true);

//
//define('BASE_PATH', realpath(dirname(__FILE__) . '/../../'));
//define('APPLICATION_PATH', BASE_PATH . '/application');


//// Include path
//set_include_path(
//    '.'
//    . PATH_SEPARATOR . BASE_PATH . '/library'
//    . PATH_SEPARATOR . get_include_path()
//);
//
//// Define application environment
//define('APPLICATION_ENV', 'testing');
//*/
///** Zend_Application */
////require_once 'Zend/Application.php';
//
//// Create application, bootstrap, and run
//
////require_once 'controllers/ControllerTestCase.php';
//
// Define application environment
define('APPLICATION_ENV', 'testing');

//$config = new Zend_Config_Ini(SP_APPLICATION_PATH . "/configs/application.ini", APPLICATION_ENV);
Lua_Config::load(array('database'));
$config = Lua_Config::getConfig();
//var_dump($config);die;
$db = Zend_Db::factory($config['resources']['db']['adapter'], $config['resources']['db']['params']);
Zend_Db_Table_Abstract::setDefaultAdapter($db);

$tables = array_diff($db->listTables(), array('_metadata', 'bi_user_permission', 
    'bi_latest_comment_by_not_business_owner', 'bi_latest_comment'
//        'svplisting', 'service',
));
foreach ($tables as $table) {
    $db->delete($table);
}
